<?xml version="1.0" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>docs/hashlike.rd</title>
</head>
<body>
<h2><a name="label-0" id="label-0">Acces Methods</a></h2><!-- RDLabel: "Acces Methods" -->
<p>These are the common methods for <var>BDB::Btree</var>, <var>BDB::Hash</var>,
<var>BDB::Recno</var> and <var>BDB::Queue</var></p>
<ul>
<li><a href="#label-1">Class Methods</a></li>
<li><a href="#label-45">Methods</a></li>
<li><a href="#label-120">Methods specific to BDB::Recno and BDB::Queue</a></li>
</ul>
<h3><a name="label-1" id="label-1">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
<dl>
<dt><a name="label-2" id="label-2"><code>open(<var>name</var> = <var>nil</var>, <var>subname</var> = <var>nil</var>, <var>flags</var> = <var>0</var>, <var>mode</var> = <var>0</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "open" -->
<dt><a name="label-3" id="label-3"><code>create(<var>name</var> = <var>nil</var>, <var>subname</var> = <var>nil</var>, <var>flags</var> = <var>0</var>, <var>mode</var> = <var>0</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "create" -->
<dt><a name="label-4" id="label-4"><code>new(<var>name</var> = <var>nil</var>, <var>subname</var> = <var>nil</var>, <var>flags</var> = <var>0</var>, <var>mode</var> = <var>0</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "new" -->
<dd>
open the database
<dl>
<dt><a name="label-5" id="label-5"><var>name</var></a></dt><!-- RDLabel: "name" -->
<dd>
The argument name is used as the name of a single physical
file on disk that will be used to back the database.
</dd>
<dt><a name="label-6" id="label-6"><var>subname</var></a></dt><!-- RDLabel: "subname" -->
<dd>
The subname argument allows applications to have
subdatabases, i.e., multiple databases inside of a single physical
file. This is useful when the logical databases are both
numerous and reasonably small, in order to avoid creating a large
number of underlying files. It is an error to attempt to open a
subdatabase in a database file that was not initially
created using a subdatabase name.
</dd>
<dt><a name="label-7" id="label-7"><var>flags</var></a></dt><!-- RDLabel: "flags" -->
<dd>
<p>The flags must be the string "r", "r+", "w", "w+", "a", "a+" or
and integer value.</p>
<p>The flags value must be set to 0 or by bitwise inclusively
OR'ing together one or more of the following values</p>
<dl>
<dt><a name="label-8" id="label-8"><var>BDB::CREATE</var></a></dt><!-- RDLabel: "BDB::CREATE" -->
<dd>
Create any underlying files, as necessary. If the files
do not already exist and the DB_CREATE flag is not
specified, the call will fail. 
</dd>
<dt><a name="label-9" id="label-9"><var>BD::EXCL</var></a></dt><!-- RDLabel: "BD::EXCL" -->
<dd>
Return an error if the database already exists. Underlying
filesystem primitives are used to implement this
flag. For this reason it is only applicable to the
physical database file and cannot be used to test if a
subdatabase already exists. 
</dd>
<dt><a name="label-10" id="label-10"><var>BDB::NOMMAP</var></a></dt><!-- RDLabel: "BDB::NOMMAP" -->
<dd>
Do not map this database into process memory.
</dd>
<dt><a name="label-11" id="label-11"><var>BDB::RDONLY</var></a></dt><!-- RDLabel: "BDB::RDONLY" -->
<dd>
Open the database for reading only. Any attempt to
modify items in the database will fail regardless of the
actual permissions of any underlying files. 
</dd>
<dt><a name="label-12" id="label-12"><var>BDB::TRUNCATE</var></a></dt><!-- RDLabel: "BDB::TRUNCATE" -->
<dd>
<p>Physically truncate the underlying database file,
discarding all previous subdatabases or databases.
Underlying filesystem primitives are used to implement
this flag. For this reason it is only applicable to the
physical database file and cannot be used to discard
subdatabases.</p>
<p>The DB_TRUNCATE flag cannot be transaction protected,
and it is an error to specify it in a transaction
protected environment. </p>
</dd>
</dl>
</dd>
<dt><a name="label-13" id="label-13"><var>options</var></a></dt><!-- RDLabel: "options" -->
<dd>
<p>Hash, Possible options are (see the documentation of Berkeley DB
for more informations) </p>
<dl>
<dt><a name="label-14" id="label-14"><var>store_nil_as_null</var>: if `true' will store `nil' as `\000', otherwise as an empty string (default `false')</a></dt><!-- RDLabel: "store_nil_as_null: if `true' will store `nil' as `\000', otherwise as an empty string (default `false')" -->
<dt><a name="label-15" id="label-15"><var>set_array_base</var>: base index for BDB::Recno, BDB::Queue or BDB::Btree (with BDB::RECNUM). Must be 0 or 1</a></dt><!-- RDLabel: "set_array_base: base index for BDB::Recno, BDB::Queue or BDB::Btree (with BDB::RECNUM). Must be 0 or 1" -->
<dt><a name="label-16" id="label-16"><var>set_bt_compare</var> :  specify a Btree comparison function</a></dt><!-- RDLabel: "set_bt_compare :  specify a Btree comparison function" -->
<dt><a name="label-17" id="label-17"><var>set_bt_minkey</var> :   set the minimum number of keys per Btree page</a></dt><!-- RDLabel: "set_bt_minkey :   set the minimum number of keys per Btree page" -->
<dt><a name="label-18" id="label-18"><var>set_bt_prefix</var> :   specify a Btree prefix comparison function</a></dt><!-- RDLabel: "set_bt_prefix :   specify a Btree prefix comparison function" -->
<dt><a name="label-19" id="label-19"><var>set_cachesize</var> :   set the database cache size</a></dt><!-- RDLabel: "set_cachesize :   set the database cache size" -->
<dt><a name="label-20" id="label-20"><var>set_dup_compare</var> :  specify a duplicate comparison function</a></dt><!-- RDLabel: "set_dup_compare :  specify a duplicate comparison function" -->
<dt><a name="label-21" id="label-21"><var>set_store_key</var> : specify a Proc called before a key is stored</a></dt><!-- RDLabel: "set_store_key : specify a Proc called before a key is stored" -->
<dt><a name="label-22" id="label-22"><var>set_fetch_key</var> : specify a Proc called after a key is read</a></dt><!-- RDLabel: "set_fetch_key : specify a Proc called after a key is read" -->
<dt><a name="label-23" id="label-23"><var>set_store_value</var> : specify a Proc called before a value is stored</a></dt><!-- RDLabel: "set_store_value : specify a Proc called before a value is stored" -->
<dt><a name="label-24" id="label-24"><var>set_fetch_value</var> : specify a Proc called after a value is read</a></dt><!-- RDLabel: "set_fetch_value : specify a Proc called after a value is read" -->
<dt><a name="label-25" id="label-25"><var>set_flags</var> :  general database configuration</a></dt><!-- RDLabel: "set_flags :  general database configuration" -->
<dt><a name="label-26" id="label-26"><var>set_h_ffactor</var> :  set the Hash table density</a></dt><!-- RDLabel: "set_h_ffactor :  set the Hash table density" -->
<dt><a name="label-27" id="label-27"><var>set_h_hash</var> :  specify a hashing function</a></dt><!-- RDLabel: "set_h_hash :  specify a hashing function" -->
<dt><a name="label-28" id="label-28"><var>set_h_nelem</var> :  set the Hash table size</a></dt><!-- RDLabel: "set_h_nelem :  set the Hash table size" -->
<dt><a name="label-29" id="label-29"><var>set_lorder</var> :  set the database byte order</a></dt><!-- RDLabel: "set_lorder :  set the database byte order" -->
<dt><a name="label-30" id="label-30"><var>set_pagesize</var> :  set the underlying database page size</a></dt><!-- RDLabel: "set_pagesize :  set the underlying database page size" -->
<dt><a name="label-31" id="label-31"><var>set_re_delim</var> :  set the variable-length record delimiter</a></dt><!-- RDLabel: "set_re_delim :  set the variable-length record delimiter" -->
<dt><a name="label-32" id="label-32"><var>set_re_len</var> :   set the fixed-length record length</a></dt><!-- RDLabel: "set_re_len :   set the fixed-length record length" -->
<dt><a name="label-33" id="label-33"><var>set_re_pad</var> :   set the fixed-length record pad byte</a></dt><!-- RDLabel: "set_re_pad :   set the fixed-length record pad byte" -->
<dt><a name="label-34" id="label-34"><var>set_re_source</var> :  set the backing Recno text file</a></dt><!-- RDLabel: "set_re_source :  set the backing Recno text file" -->
<dt><a name="label-35" id="label-35"><var>set_append_recno</var> : modify the stored data for <var>BDB::APPEND</var></a></dt><!-- RDLabel: "set_append_recno : modify the stored data for BDB::APPEND" -->
<dt><a name="label-36" id="label-36"><var>set_encrypt</var> : set the password used</a></dt><!-- RDLabel: "set_encrypt : set the password used" -->
<dt><a name="label-37" id="label-37"><var>set_feedback</var> : set the function to monitor some operations</a></dt><!-- RDLabel: "set_feedback : set the function to monitor some operations" -->
<dt><a name="label-38" id="label-38"><var>env</var> :  open the database in the environnement given as the value</a></dt><!-- RDLabel: "env :  open the database in the environnement given as the value" -->
<dt><a name="label-39" id="label-39"><var>txn</var> :  open the database in the transaction given as the value</a></dt><!-- RDLabel: "txn :  open the database in the transaction given as the value" -->
</dl>
<p><var>set_append_recno</var> will be called with (key, value) and
it must return <var>nil</var> or the modified value</p>
<p><var>set_encrypt</var> take an Array as arguments with the values
[password, flags], where flags can be 0 or <var>BDB::ENCRYPT_AES</var></p>
<p>Proc given to <var>set_bt_compare</var>, <var>set_bt_prefix</var>, 
<var>set_dup_compare</var>, <var>set_h_hash</var>, <var>set_store_key</var>
<var>set_fetch_key</var>, <var>set_store_value</var>, <var>set_fetch_value</var>
<var>set_feedback</var> and <var>set_append_recno</var>
can be also specified as a method (replace the prefix <var>set_</var> 
with <var>bdb_</var>)</p>
<pre>For example 

  module BDB
     class Btreesort &lt; Btree
        def bdb_bt_compare(a, b)
           b.downcase &lt;=&gt; a.downcase
        end
     end
  end</pre>
</dd>
</dl></dd>
<dt><a name="label-40" id="label-40"><code>remove(<var>name</var>, <var>subname</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "remove" -->
<dt><a name="label-41" id="label-41"><code>db_remove(<var>name</var>, <var>subname</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "db_remove" -->
<dt><a name="label-42" id="label-42"><code>unlink(<var>name</var>, <var>subname</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "unlink" -->
<dd>
<p>Removes the database (or subdatabase) represented by the
name and subname combination.</p>
<p>If no subdatabase is specified, the physical file represented by name
is removed, incidentally removing all subdatabases that it contained.</p></dd>
<dt><a name="label-43" id="label-43"><code>upgrade(<var>name</var>)</code></a></dt><!-- RDLabel: "upgrade" -->
<dt><a name="label-44" id="label-44"><code>db_upgrade(<var>name</var>)</code></a></dt><!-- RDLabel: "db_upgrade" -->
<dd>
Upgrade the database</dd>
</dl>
<h3><a name="label-45" id="label-45">Methods</a></h3><!-- RDLabel: "Methods" -->
<dl>
<dt><a name="label-46" id="label-46"><code>self[key]</code></a></dt><!-- RDLabel: "self[key]" -->
<dd>
Returns the value corresponding the <var>key</var></dd>
<dt><a name="label-47" id="label-47"><code>associate(<var>db</var>, <var>flag</var> = <var>0</var>) { |<var>db</var>, <var>key</var>, <var>value</var>| }</code></a></dt><!-- RDLabel: "associate" -->
<dd>
<p>associate a secondary index db</p>
<p><var>flag</var> can have the value <var>BDB::RDONLY</var></p>
<p>The block must return the new key, or <var>Qfalse</var> in this case the
secondary index will not contain any reference to key/value</p></dd>
<dt><a name="label-48" id="label-48"><code>cache_priority</code></a></dt><!-- RDLabel: "cache_priority" -->
<dd>
return the current priority value</dd>
<dt><a name="label-49" id="label-49"><code>cache_priority=value</code></a></dt><!-- RDLabel: "cache_priority=value" -->
<dd>
set the priority value : can be <var>BDB::PRIORITY_VERY_LOW</var>,
<var>BDB::PRIORITY_LOW</var>,  <var>BDB::PRIORITY_DEFAULT</var>,
<var>BDB::PRIORITY_HIGH</var> or <var>BDB::PRIORITY_VERY_HIGH</var></dd>
<dt><a name="label-50" id="label-50"><code>feedback=(<var>proc</var>)</code></a></dt><!-- RDLabel: "feedback=" -->
<dd>
monitor the progress of some operations</dd>
<dt><a name="label-51" id="label-51"><code>get(<var>key</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "get" -->
<dt><a name="label-52" id="label-52"><code>db_get(<var>key</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "db_get" -->
<dt><a name="label-53" id="label-53"><code>fetch(<var>key</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "fetch" -->
<dd>
<p>Returns the value correspondind the <var>key</var></p>
<p><var>flags</var> can have the values <var>BDB::GET_BOTH</var>, 
<var>BDB::SET_RECNO</var> or <var>BDB::RMW</var></p>
<p>In presence of duplicates it will return the first data item, use
#duplicates if you want all duplicates (see also #each_dup)</p></dd>
<dt><a name="label-54" id="label-54"><code>pget(<var>key</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "pget" -->
<dd>
<p>Returns the primary key and the value corresponding to <var>key</var>
in the secondary index</p>
<p>only with &gt;= 3.3.11</p></dd>
<dt><a name="label-55" id="label-55"><code>self[key] = <var>value</var></code></a></dt><!-- RDLabel: "self[key] = value" -->
<dd>
<p>Stores the <var>value</var> associating with <var>key</var></p>
<p>If <var>nil</var> is given as the value, the association from the key will be
removed. </p></dd>
<dt><a name="label-56" id="label-56"><code>put(<var>key</var>, <var>value</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "put" -->
<dt><a name="label-57" id="label-57"><code>db_put(<var>key</var>, <var>value</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "db_put" -->
<dt><a name="label-58" id="label-58"><code>store(<var>key</var>, <var>value</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "store" -->
<dd>
<p>Stores the <var>value</var> associating with <var>key</var></p>
<p>If <var>nil</var> is given as the value, the association from the <var>key</var>
will be removed. It return the object deleted or <var>nil</var> if the
specified key don't exist.</p>
<p><var>flags</var> can have the value <var>DBD::NOOVERWRITE</var>, in this case
it will return <var>nil</var> if the specified key exist, otherwise <var>true</var></p></dd>
<dt><a name="label-59" id="label-59"><code>append(<var>key</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "append" -->
<dt><a name="label-60" id="label-60"><code>db_append(<var>key</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "db_append" -->
<dd>
Append the <var>value</var> associating with <var>key</var></dd>
<dt><a name="label-61" id="label-61"><code>byteswapped?</code></a></dt><!-- RDLabel: "byteswapped?" -->
<dt><a name="label-62" id="label-62"><code>get_byteswapped</code></a></dt><!-- RDLabel: "get_byteswapped" -->
<dd>
Return if the underlying database is in host order</dd>
<dt><a name="label-63" id="label-63"><code>clear_partial</code></a></dt><!-- RDLabel: "clear_partial" -->
<dt><a name="label-64" id="label-64"><code>partial_clear</code></a></dt><!-- RDLabel: "partial_clear" -->
<dd>
Clear partial set.</dd>
<dt><a name="label-65" id="label-65"><code>close(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "close" -->
<dt><a name="label-66" id="label-66"><code>db_close(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "db_close" -->
<dd>
Closes the file.</dd>
<dt><a name="label-67" id="label-67"><code>count(<var>key</var>)</code></a></dt><!-- RDLabel: "count" -->
<dt><a name="label-68" id="label-68"><code>dup_count(<var>key</var>)</code></a></dt><!-- RDLabel: "dup_count" -->
<dd>
Return the count of duplicate for <var>key</var></dd>
<dt><a name="label-69" id="label-69"><code>cursor(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "cursor" -->
<dt><a name="label-70" id="label-70"><code>db_cursor(<var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "db_cursor" -->
<dd>
Open a new cursor.</dd>
<dt><a name="label-71" id="label-71"><code>database()</code></a></dt><!-- RDLabel: "database" -->
<dt><a name="label-72" id="label-72"><code>subname()</code></a></dt><!-- RDLabel: "subname" -->
<dd>
Return the subname</dd>
<dt><a name="label-73" id="label-73"><code>delete(<var>key</var>)</code></a></dt><!-- RDLabel: "delete" -->
<dt><a name="label-74" id="label-74"><code>db_del(<var>key</var>)</code></a></dt><!-- RDLabel: "db_del" -->
<dd>
<p>Removes the association from the key. </p>
<p>It return the object deleted or <var>nil</var> if the specified
key don't exist.</p></dd>
<dt><a name="label-75" id="label-75"><code>delete_if(<var>set</var> = <var>nil</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "delete_if" -->
<dt><a name="label-76" id="label-76"><code>reject!(<var>set</var> = <var>nil</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "reject!" -->
<dd>
<p>Deletes associations if the evaluation of the block returns true. </p>
<p><a href="#label-125">set</a></p></dd>
<dt><a name="label-77" id="label-77"><code>duplicates(<var>key</var> , <var>assoc</var> = <var>true</var>)</code></a></dt><!-- RDLabel: "duplicates" -->
<dd>
<p>Return an array of all duplicate associations for <var>key</var></p>
<p>if <var>assoc</var> is <var>false</var> return only the values.</p></dd>
<dt><a name="label-78" id="label-78"><code>each(<var>set</var> = <var>nil</var>, <var>bulk</var> = <var>0</var>, "<var>flags</var>" =&gt; <var>0</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "each" -->
<dt><a name="label-79" id="label-79"><code>each_pair(<var>set</var> = <var>nil</var>, <var>bulk</var> = <var>0</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "each_pair" -->
<dd>
<p>Iterates over associations.</p>
<p><a href="#label-125">set</a> <a href="#label-126">bulk</a></p></dd>
<dt><a name="label-80" id="label-80"><code>each_by_prefix(<var>prefix</var>) {|<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "each_by_prefix" -->
<dd>
Iterate over associations, where the key begin with <var>prefix</var></dd>
<dt><a name="label-81" id="label-81"><code>each_dup(<var>key</var>, <var>bulk</var> = <var>0</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "each_dup" -->
<dd>
<p>Iterates over each duplicate associations for <var>key</var></p>
<p><a href="#label-126">bulk</a></p></dd>
<dt><a name="label-82" id="label-82"><code>each_dup_value(<var>key</var>, <var>bulk</var> = <var>0</var>) { |<var>value</var>| ... }</code></a></dt><!-- RDLabel: "each_dup_value" -->
<dd>
<p>Iterates over each duplicate values for <var>key</var></p>
<p><a href="#label-126">bulk</a></p></dd>
<dt><a name="label-83" id="label-83"><code>each_key(<var>set</var> = <var>nil</var>, <var>bulk</var> = <var>0</var>) { |<var>key</var>| ... }</code></a></dt><!-- RDLabel: "each_key" -->
<dd>
<p>Iterates over keys. </p>
<p><a href="#label-125">set</a> <a href="#label-126">bulk</a></p></dd>
<dt><a name="label-84" id="label-84"><code>each_primary(<var>set</var> = <var>nil</var>) { |<var>skey</var>, <var>pkey</var>, <var>pvalue</var>| ... }</code></a></dt><!-- RDLabel: "each_primary" -->
<dd>
Iterates over secondary indexes and give secondary key, primary key
and value</dd>
<dt><a name="label-85" id="label-85"><code>each_value(<var>set</var> = <var>nil</var>, <var>bulk</var> = <var>0</var>) { |<var>value</var>| ... }</code></a></dt><!-- RDLabel: "each_value" -->
<dd>
<p>Iterates over values. </p>
<p><a href="#label-125">set</a> <a href="#label-126">bulk</a></p></dd>
<dt><a name="label-86" id="label-86"><code>empty?()</code></a></dt><!-- RDLabel: "empty?" -->
<dd>
Returns true if the database is empty. </dd>
<dt><a name="label-87" id="label-87"><code>filename()</code></a></dt><!-- RDLabel: "filename" -->
<dd>
Return the name of the file</dd>
<dt><a name="label-88" id="label-88"><code>has_key?(<var>key</var>)</code></a></dt><!-- RDLabel: "has_key?" -->
<dt><a name="label-89" id="label-89"><code>key?(<var>key</var>)</code></a></dt><!-- RDLabel: "key?" -->
<dt><a name="label-90" id="label-90"><code>include?(<var>key</var>)</code></a></dt><!-- RDLabel: "include?" -->
<dt><a name="label-91" id="label-91"><code>member?(<var>key</var>)</code></a></dt><!-- RDLabel: "member?" -->
<dd>
Returns true if the association from the <var>key</var> exists.</dd>
<dt><a name="label-92" id="label-92"><code>has_both?(<var>key</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "has_both?" -->
<dt><a name="label-93" id="label-93"><code>both?(<var>key</var>, <var>value</var>)</code></a></dt><!-- RDLabel: "both?" -->
<dd>
Returns true if the association from <var>key</var> is <var>value</var> </dd>
<dt><a name="label-94" id="label-94"><code>has_value?(<var>value</var>)</code></a></dt><!-- RDLabel: "has_value?" -->
<dt><a name="label-95" id="label-95"><code>value?(<var>value</var>)</code></a></dt><!-- RDLabel: "value?" -->
<dd>
Returns true if the association to the <var>value</var> exists. </dd>
<dt><a name="label-96" id="label-96"><code>index(<var>value</var>)</code></a></dt><!-- RDLabel: "index" -->
<dd>
Returns the first <var>key</var> associated with <var>value</var></dd>
<dt><a name="label-97" id="label-97"><code>indexes(<var>value1</var>, <var>value2</var>, )</code></a></dt><!-- RDLabel: "indexes" -->
<dd>
Returns the <var>keys</var> associated with <var>value1, value2, ...</var></dd>
<dt><a name="label-98" id="label-98"><code>join(<var>cursor</var> , <var>flag</var> = <var>0</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "join" -->
<dd>
Perform a join. <var>cursor</var> is an array of <var>BDB::Cursor</var></dd>
<dt><a name="label-99" id="label-99"><code>keys</code></a></dt><!-- RDLabel: "keys" -->
<dd>
Returns the array of the keys in the database</dd>
<dt><a name="label-100" id="label-100"><code>length</code></a></dt><!-- RDLabel: "length" -->
<dt><a name="label-101" id="label-101"><code>size</code></a></dt><!-- RDLabel: "size" -->
<dd>
Returns the number of association in the database.</dd>
<dt><a name="label-102" id="label-102"><code>log_register(<var>name</var>)</code></a></dt><!-- RDLabel: "log_register" -->
<dd>
The <var>log_register</var> function registers a file <var>name</var>.</dd>
<dt><a name="label-103" id="label-103"><code>log_unregister()</code></a></dt><!-- RDLabel: "log_unregister" -->
<dd>
The <var>log_unregister</var> function unregisters a file name.</dd>
<dt><a name="label-104" id="label-104"><code>reject { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "reject" -->
<dd>
Create an hash without the associations if the evaluation of the
block returns true. </dd>
<dt><a name="label-105" id="label-105"><code>reverse_each(<var>set</var> = <var>nil</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "reverse_each" -->
<dt><a name="label-106" id="label-106"><code>reverse_each_pair(<var>set</var> = <var>nil</var>) { |<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "reverse_each_pair" -->
<dd>
<p>Iterates over associations in reverse order </p>
<p><a href="#label-125">set</a></p></dd>
<dt><a name="label-107" id="label-107"><code>reverse_each_by_prefix(<var>prefix</var>) {|<var>key</var>, <var>value</var>| ... }</code></a></dt><!-- RDLabel: "reverse_each_by_prefix" -->
<dd>
Iterate over associations in reverse order, where the key begin
with <var>prefix</var></dd>
<dt><a name="label-108" id="label-108"><code>reverse_each_key(<var>set</var> = <var>nil</var>) { |<var>key</var>| ... }</code></a></dt><!-- RDLabel: "reverse_each_key" -->
<dd>
<p>Iterates over keys in reverse order </p>
<p><a href="#label-125">set</a></p></dd>
<dt><a name="label-109" id="label-109"><code>reverse_each_primary(<var>set</var> = <var>nil</var>) { |<var>skey</var>, <var>pkey</var>, <var>pvalue</var>| ... }</code></a></dt><!-- RDLabel: "reverse_each_primary" -->
<dd>
Iterates over secondary indexes in reverse order and give secondary
key, primary key and value</dd>
<dt><a name="label-110" id="label-110"><code>reverse_each_value(<var>set</var> = <var>nil</var>) { |<var>value</var>| ... }</code></a></dt><!-- RDLabel: "reverse_each_value" -->
<dd>
<p>Iterates over values in reverse order.</p>
<p><a href="#label-125">set</a></p></dd>
<dt><a name="label-111" id="label-111"><code>set_partial(<var>len</var>, <var>offset</var>)</code></a></dt><!-- RDLabel: "set_partial" -->
<dd>
Set the partial value <var>len</var> and <var>offset</var></dd>
<dt><a name="label-112" id="label-112"><code>stat</code></a></dt><!-- RDLabel: "stat" -->
<dd>
Return database statistics.</dd>
<dt><a name="label-113" id="label-113"><code>to_a</code></a></dt><!-- RDLabel: "to_a" -->
<dd>
Return an array of all associations [key, value]</dd>
<dt><a name="label-114" id="label-114"><code>to_hash</code></a></dt><!-- RDLabel: "to_hash" -->
<dd>
Return an hash of all associations {key =&gt; value}</dd>
<dt><a name="label-115" id="label-115"><code>truncate</code></a></dt><!-- RDLabel: "truncate" -->
<dt><a name="label-116" id="label-116"><code>clear</code></a></dt><!-- RDLabel: "clear" -->
<dd>
Empty a database</dd>
<dt><a name="label-117" id="label-117"><code>values</code></a></dt><!-- RDLabel: "values" -->
<dd>
Returns the array of the values in the database.</dd>
<dt><a name="label-118" id="label-118"><code>verify(<var>file</var> = <var>nil</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "verify" -->
<dd>
Verify the integrity of the DB file, and optionnally output the
key/data to <var>file</var> (file must respond to #to_io)</dd>
<dt><a name="label-119" id="label-119"><code>compact(<var>start</var> = <var>nil</var>, <var>stop</var> = <var>nil</var>, <var>options</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "compact" -->
<dd>
Only for Btree and Recno (DB VERSION &gt;= 4.4)
<ul>
<li><var>start</var> starting point for compaction in a Btree or Recno database.
      Compaction will start at the smallest key greater than or equal to the
      specified key. </li>
<li><var>stop</var> the stopping point for compaction in a Btree or Recno database.
      Compaction will stop at the page with the smallest key greater 
      than the specified key</li>
<li><var>options</var> hash with the possible keys
<ul>
<li><var>flags</var> with the value 0, <var>BDB::FREELIST_ONLY</var>, or
        <var>BDB::FREE_SPACE</var></li>
<li><var>compact_fillpercent</var>the goal for filling pages, specified as a
        percentage between 1 and 100.</li>
<li><var>compact_timeout</var> the lock timeout set for implicit transactions, 
        in microseconds.</li>
</ul></li>
</ul></dd>
</dl>
<h3><a name="label-120" id="label-120">Methods specific to BDB::Recno and BDB::Queue</a></h3><!-- RDLabel: "Methods specific to BDB::Recno and BDB::Queue" -->
<dl>
<dt><a name="label-121" id="label-121"><code>pop</code></a></dt><!-- RDLabel: "pop" -->
<dd>
Returns the last couple [key, val] (only for BDB::Recno)</dd>
<dt><a name="label-122" id="label-122"><code>push <var>values</var></code></a></dt><!-- RDLabel: "push values" -->
<dd>
Push the values</dd>
<dt><a name="label-123" id="label-123"><code>shift</code></a></dt><!-- RDLabel: "shift" -->
<dd>
Removes and returns an association from the database.</dd>
</dl>
<h3><a name="label-124" id="label-124">Remark</a></h3><!-- RDLabel: "Remark" -->
<h4><a name="label-125" id="label-125">set</a></h4><!-- RDLabel: "set" -->
<p>If the parameter <var>set</var> is given, an initial call will be made
with the option <var>BDB::SET_RANGE</var> to move the cursor to the specified
key before iterating.</p>
<h4><a name="label-126" id="label-126">bulk</a></h4><!-- RDLabel: "bulk" -->
<p>Only with &gt;= 3.3.11 : if the parameter <var>bulk</var> is given, 
an application buffer of size <var>bulk * 1024</var> will be used 
(see "Retrieving records in bulk" in the documentation of BerkeleyDB)</p>

</body>
</html>
